{% extends "wltheme/ucenter/ucenter_base.html" %}
{% load wlcore_tags %}

{% block breadcrumb_menu_more %}
    <li xmlns="http://www.w3.org/1999/html">
        <a href="/uc/personal_setting" class="am-active">账户设置</a>
    </li>
{% endblock %}

{% block main_nav %}
    <ul class="main_nav am-nav am-nav-pills" id="main_nav">
        <li>
            <a href="/uc/personal_setting/">基本信息</a>
        </li>
        <li>
            <a href="/uc/user_identity/">我的身份</a>
        </li>
        <li>
            <a href="/uc/auth_notify/">权限与通知</a>
        </li>
        <li>
            <a href="/accounts/password/update/" class="active">修改密码</a>
        </li>
    </ul>
{% endblock %}

{% block main_content %}
    <form method="post" class=" am-form am-form-horizontal">
        {% csrf_token %}

        <fieldset>
            <div class="am-g">
                <form method="post" class=" am-form am-form-horizontal  am-u-sm-centered">
                    <div class="am-form-group">
                        <label for="{{ form.currentPassword.id_for_label }}"
                               class="am-u-sm-3 am-form-label">当前密码:</label>

                        <div class="am-u-sm-4">
                            {{ form.currentPassword }}
                        </div>
                        <div class="pwd-error-tip">
                            {{ form.currentPassword.errors.0 }}
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label for="{{ form.password1.id_for_label }}" class="am-u-sm-3 am-form-label">修改密码:</label>

                        <div class="am-u-sm-4">
                            {{ form.password1 }}
                        </div>
                        <div class="pwd-error-tip">
                            {{ form.password1.errors.0 }}
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label for="{{ form.password2.id_for_label }}" class="am-u-sm-3 am-form-label">重复密码:</label>

                        <div class="am-u-sm-4">
                            {{ form.password2 }}
                        </div>
                        <div class="pwd-error-tip">
                            {{ form.password2.errors.0 }}
                        </div>
                    </div>
                </form>
            </div>
            <div class="am-u-sm-4 am-u-sm-centered form-actions">
                {% block account_form_actions %}
                    <input class="am-btn  am-btn-primary am-u-sm-8 " type="submit" value="更新密码"/>
                {% endblock %}
            </div>
        </fieldset>
    </form>
    <div class="am-modal am-modal-alert" tabindex="-1" id="update_success">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">重置密码</div>
            <div class="am-modal-bd">
                重置密码成功。
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn">确定</span>
            </div>
        </div>
    </div>
{% endblock %}

{% block js %}
    <script src="{{ STATIC_URL }}{{ "wltheme/js/account/signVerify.js"|file_time_stamp }}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var success ={{success}};
            if (success == 1) {
                $('#update_success').modal({
                    relatedTarget: this,
                    onConfirm: function (options) {
                    }
                });
            }
        });
    </script>
{% endblock %}
<!--endblock js-->
{% block extra_css %}
    {{ block.super }}
    <link rel="stylesheet" href="{{ STATIC_URL }}{{ "wltheme/css/account.css"|file_time_stamp }}">
{% endblock %}
